package net.stevechaloner.idea.ffs.model.xml;

import net.stevechaloner.idea.ffs.model.Translator;

/**
 * Translator for XML-based models.
 *
 * @author Steve Chaloner
 */
public class XmlModelTranslator implements Translator
{
    // javadoc inherited
    public String translateToIdeaFriendlyModel(String original)
    {
        original = original.replaceAll("<SearchPlugin", "<search-plugin");
        original = original.replaceAll("</SearchPlugin", "</search-plugin");
        original = original.replaceAll("<ShortName", "<short-name");
        original = original.replaceAll("</ShortName>", "</short-name>");
        original = original.replaceAll("<Description", "<description");
        original = original.replaceAll("</Description>", "</description>");
        original = original.replaceAll("<InputEncoding", "<input-encoding");
        original = original.replaceAll("</InputEncoding>", "</input-encoding>");
        original = original.replaceAll("<Url", "<url");
        original = original.replaceAll("</Url>", "</url>");
        original = original.replaceAll("<Param", "<param");
        original = original.replaceAll("</Param>", "</param>");
        original = original.replaceAll("<SearchForm", "<search-form");
        original = original.replaceAll("</SearchForm>", "</search-form>");
        return original;
    }
}
